

function request(type , path , data) {
    return new Promise((resolve , reject) => {
        ajax({
            type ,
            path ,
            data , 
            success : res => {
                resolve(res) ;
            }
        })
    })

}




// function reg (data) {
//     const p = request('post' , '../php/reg.php' ,data) ;
//     return p 
// }

const reg = data => request('post' , '../php/reg.php' ,data) ;

const login = data => request('get' , '../php/login.php' , data) ;

